/*
 * @Author: Wxx
 * @Date: 2022-02-25 10:28:08
 * @LastEditors: Wxx
 * @LastEditTime: 2022-02-25 11:17:33
 * @Description:反向代理配置
 */
const { createProxyMiddleware } = require("http-proxy-middleware");

module.exports = function (app) {
  app.use(
    "/ajax",
    createProxyMiddleware({
      target: "https://i.maoyan.com",
      changeOrigin: true,
    })
  );
  //有多个代理需要配置时 追加在后面即可
  // app.use(
  //   "/ajax1",
  //   createProxyMiddleware({
  //     target: "https://i1.maoyan.com",
  //     changeOrigin: true,
  //   })
  // );
  // app.use(
  //   "/ajax2",
  //   createProxyMiddleware({
  //     target: "https://i2.maoyan.com",
  //     changeOrigin: true,
  //   })
  // );
};
